package com.sh.pojo.domain;

import com.alibaba.fastjson.JSONObject;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

@Data
public class YunQiaoUserDomain {
    private String id;
    private String userName;
    private String displayName;
    private Boolean active;
    private Boolean deleted;
    private List<JSONObject> emails;
    private List<JSONObject> phoneNumbers;


    public List<String> getEmails() {
        if (emails == null || emails.isEmpty()) {
            return null;
        }
        List<String> emailList = new ArrayList<>();
        emails.forEach(e -> {
            emailList.add(e.getString("value"));
        });
        return emailList;
    }

    public List<String> getPhoneNumbers() {
        if (phoneNumbers == null || phoneNumbers.isEmpty()) {
            return null;
        }
        List<String> phoneList = new ArrayList<>();
        phoneNumbers.forEach(e -> {
            phoneList.add(e.getString("value"));
        });
        return phoneList;
    }


}
